//package com.patrol.controller;
//import com.patrol.auth.pojo.AdminUser;
//import com.patrol.service.UserInformationService;
//import com.patrol.utils.Msg;
//import com.patrol.utils.Result;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletRequest;
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * @author 宋灿
// * @version 1.0
// * @description: TODO
// * @date 2021/8/13 9:25
// */
//@Slf4j
//@CrossOrigin
//@Api(value = "个人中心接口")
//@RestController
//@RequestMapping("/api")
//public class    UserInformationController {
//    @Resource
//    private UserInformationService userInformationService;
//
//    @ApiOperation(value = "获取登录用户信息")
//    @GetMapping("/user/getUserInformation")
//    public Result<AdminUser> getUserInformation(HttpServletRequest request) {
//        String username = (String) request.getSession().getAttribute("LoginUser");
//        AdminUser adminUser = userInformationService.getUserInformation(username);
//        return Result.ok(adminUser);
//    }
//    @ApiOperation(value = "修改登录用户信息")
//    @PutMapping("/user/setUserInformation")
//    public Result getAdminUser(AdminUser adminUser) {
//        // String username = (String) request.getSession().getAttribute("LoginUser");
//        String username = adminUser.getUsername();
//        boolean b = userInformationService.setUserInformation(adminUser);
//        if (b) {
//            return Result.ok();
//        }
//        return Result.fail();
//    }
//    /**
//     * 获取登录用户名
//     */
////    @ApiOperation(value = "获取用户登录名")
////    @GetMapping("/user/getUsername")
////    public Result getUserName(@SessionAttribute("LoginUser") String username) {
////        String url = userInformationService.getImgUrl(username);
////        List<String> list = new ArrayList<>();
////        list.add(username);
////        list.add(url);
////        log.info("list:" + list);
////        return Result.ok(list);
////    }
//    /**
//     * 获取登录用户名
//     */
//    @ApiOperation(value = "获取用户头像url")
//    @GetMapping("/user/getImageUrl/{username}")
//    public Result getImageUrl(@PathVariable String username) {
//        String url = userInformationService.getImgUrl(username);
//        List<String> list = new ArrayList<>();
//        list.add(url);
//
//        return Result.ok(list);
//    }
//}
